﻿<form id="frm_edit_user" novalidate>
    <div class="modal-header">
        <button type="button" class="close" ng-click="vm.close()" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">
            <span>@L("EditUser")</span>
        </h4>
    </div>
    <div class="modal-body">
        <uib-tabset class="tab-container tabbable-line">
            <uib-tab heading="User Details">
                <div class="row clearfix" style="margin-top: 10px;">
                    <div class="col-sm-12">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input id="username" type="text" name="UserName" ng-model="vm.user.userName" required maxlength="32" minlength="2" class="validate form-control">
                                <label for="username" class="form-label">@L("UserName")</label>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-sm-6">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input id="name" type="text" name="Name" ng-model="vm.user.name" required maxlength="32" class="validate form-control">
                                <label for="name" class="form-label">@L("Name")</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input id="surname" type="text" name="Surname" ng-model="vm.user.surname" required maxlength="32" class="validate form-control">
                                <label for="surname" class="form-label">@L("Surname")</label>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-sm-12">
                        <div class="form-group form-float">
                            <div class="form-line">
                                <input id="email" type="email" name="EmailAddress" ng-model="vm.user.emailAddress" maxlength="256" class="validate form-control">
                                <label for="email" class="form-label">@L("EmailAddress")</label>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row clearfix">
                    <div class="col-sm-12">
                        <div class="form-group form-float">
                            <div class="">
                                <input id="isactive" type="checkbox" name="IsActive" ng-model="vm.user.isActive" checked class="form-control" />
                                <label for="isactive" class="form-label">@L("IsActive")</label>
                            </div>
                        </div>
                    </div>
                </div>
            </uib-tab>
            <uib-tab heading="User Roles">
                <div class="row">
                    <div class="col-sm-12 ">
                        <div class="col-sm-6" ng-repeat="role in vm.roles">
                            <input type="checkbox" name="role" value="{{role.normalizedName}}" title="{{role.description}}" class="filled-in" id="role-{{role.id}}" ng-model="role.isAssigned" />
                            <label for="role-{{role.id}}" title="{{role.displayName}}">{{role.name}}</label>
                        </div>
                    </div>
                </div>
            </uib-tab>
        </uib-tabset>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default waves-effect" ng-click="vm.cancel()">
            @L("Cancel")
        </button>
        <button type="submit" class="btn btn-primary waves-effect" ng-click="vm.save()" ng-disabled="userCreateForm.$invalid">
            @L("Save")
        </button>
    </div>
</form>